package com.ssm.util;
import java.util.HashMap;
import java.util.Map;
public class InstanceCarFactory {
    private Map<String, Car> cars = null;
    public InstanceCarFactory() {
        cars = new HashMap<>();
        cars.put("nissan", new Car("nissan", 500));
        cars.put("bmw", new Car("bmw", 300));
    }
    public Car getCar(String name) {
        return cars.get(name);
    }
}

